home *** CD-ROM | disk | FTP | other *** search
/ IRIX Patches 1995 June / SGI IRIX Patches 1995 Jun.iso / 5.3_patches / patchSG0000499 / patchSG0000499.idb / usr / include / abi / X11 / extensions / XKBgeom.h.z / XKBgeom.h
Encoding:
C/C++ Source or Header  |  1995-06-12  |  7.6 KB  |  335 lines

  1. /* $XConsortium: XKBstr.h,v 1.4 93/09/28 20:16:45 rws Exp $ */
  2. /************************************************************
  3. Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc.
  4.  
  5. Permission to use, copy, modify, and distribute this
  6. software and its documentation for any purpose and without
  7. fee is hereby granted, provided that the above copyright
  8. notice appear in all copies and that both that copyright
  9. notice and this permission notice appear in supporting
  10. documentation, and that the name of Silicon Graphics not be 
  11. used in advertising or publicity pertaining to distribution 
  12. of the software without specific prior written permission.
  13. Silicon Graphics makes no representation about the suitability 
  14. of this software for any purpose. It is provided "as is"
  15. without any express or implied warranty.
  16.  
  17. SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
  18. SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
  19. AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
  20. GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL 
  21. DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, 
  22. DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
  23. OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
  24. THE USE OR PERFORMANCE OF THIS SOFTWARE.
  25.  
  26. ********************************************************/
  27.  
  28. #ifndef _XKBGEOM_H_
  29. #define    _XKBGEOM_H_
  30.  
  31. typedef    struct _XkbProperty {
  32.     char    *name;
  33.     char    *value;
  34. } XkbPropertyRec,*XkbPropertyPtr;
  35.  
  36. typedef struct _XkbRGBColor {
  37.     unsigned char    type;
  38.     unsigned char    index;
  39.     unsigned short    red;
  40.     unsigned short    green;
  41.     unsigned short    blue;
  42. } XkbRGBColorRec,*XkbRGBColorPtr;
  43.  
  44. typedef struct _XkbNamedColor {
  45.     unsigned char     type;
  46.     unsigned char    index;
  47.     char *        name;
  48. } XkbNamedColorRec,*XkbNamedColorPtr;
  49.  
  50. typedef union _XkbColor {
  51.     unsigned char        type;
  52.     struct {
  53.         unsigned char    type;
  54.         unsigned char    index;
  55.     } any;
  56.     XkbNamedColorRec    named;
  57.     XkbRGBColorRec        rgb;
  58. } XkbColorRec,*XkbColorPtr;
  59.  
  60. typedef    struct _XkbPoint {
  61.     unsigned short    x;
  62.     unsigned short    y;
  63. } XkbPointRec, *XkbPointPtr;
  64.  
  65. typedef struct _XkbOutline {
  66.     unsigned short    num_points;
  67.     unsigned short    sz_points;
  68.     unsigned short    corner_radius;
  69.     XkbPointPtr    points;
  70. } XkbOutlineRec, *XkbOutlinePtr;
  71.  
  72. typedef struct _XkbShape {
  73.     XkbKeyNameRec     name;
  74.     unsigned short     num_outlines;
  75.     unsigned short     sz_outlines;
  76.     XkbOutlinePtr     outlines;
  77.     XkbOutlinePtr     approximation;
  78.     XkbOutlinePtr     primary;
  79. } XkbShapeRec, *XkbShapePtr;
  80.  
  81. typedef struct _XkbShapeDoodad {
  82.     unsigned char     type;
  83.     unsigned char     priority;
  84.     unsigned short     top;
  85.     unsigned short     left;
  86.     unsigned short     angle;
  87.     XkbColorPtr     color;
  88.     XkbShapePtr     shape;
  89. } XkbShapeDoodadRec, *XkbShapeDoodadPtr;
  90.  
  91. typedef struct _XkbImageDoodad {
  92.     unsigned char     type;
  93.     unsigned char     priority;
  94.     unsigned short     top;
  95.     unsigned short     left;
  96.     unsigned short     width;
  97.     unsigned short     height;
  98.     unsigned short     pixel_height;
  99.     unsigned short     pixel_width;
  100.     unsigned char    *image;
  101. } XkbImageDoodadRec, *XkbImageDoodadPtr;
  102.  
  103. typedef struct _XkbTextDoodad {
  104.     unsigned char     type;
  105.     unsigned char     priority;
  106.     unsigned short     baseline;
  107.     unsigned short     left;
  108.     unsigned short     angle;
  109.     XkbColorPtr     color;
  110.     char *         text;
  111.     char *         font;
  112. } XkbTextDoodadRec, *XkbTextDoodadPtr;
  113.  
  114. typedef struct _XkbIndicatorDoodad {
  115.     unsigned char     type;
  116.     unsigned char     priority;
  117.     unsigned short     top;
  118.     unsigned short     left;
  119.     unsigned char     width;
  120.     unsigned char     height;
  121.     XkbColorPtr     on_color;
  122.     XkbColorPtr     off_color;
  123. } XkbIndicatorDoodadRec, *XkbIndicatorDoodadPtr;
  124.  
  125. typedef struct _XkbAnyDoodad {
  126.     unsigned char     type;
  127.     unsigned char     priority;
  128.     unsigned short     top;
  129.     unsigned short     left;
  130. } XkbAnyDoodadRec, *XkbAnyDoodadPtr;
  131.  
  132. typedef union _XkbDoodad {
  133.     XkbAnyDoodadRec        any;
  134.     XkbShapeDoodadRec    shape;
  135.     XkbImageDoodadRec    image;
  136.     XkbTextDoodadRec    text;
  137.     XkbIndicatorDoodadRec    indicator;
  138. } XkbDoodadRec, *XkbDoodadPtr;
  139.  
  140. #define    XkbOutlineDoodad    0
  141. #define    XkbFilledDoodad        1
  142. #define    XkbImageDoodad        2
  143. #define    XkbTextDoodad        3
  144. #define    XkbIndicatorDoodad    4
  145.  
  146. typedef struct _XkbKey {
  147.     unsigned char     name[XkbKeyNameLength];
  148.     short         gap;
  149.     XkbShapePtr     shape;
  150.     XkbColorPtr     color;
  151. } XkbKeyRec, *XkbKeyPtr;
  152.  
  153. typedef struct _XkbRow {
  154.     unsigned short     top;
  155.     unsigned short     left;
  156.     unsigned short     num_keys;
  157.     unsigned short     sz_keys;
  158.     int         vertical;
  159.     XkbKeyPtr     keys;
  160. } XkbRowRec, *XkbRowPtr;
  161.  
  162. typedef struct _XkbSection {
  163.     Atom         name;
  164.     unsigned short     top;
  165.     unsigned short     left;
  166.     unsigned short     width;
  167.     unsigned short     height;
  168.     unsigned short     angle;
  169.     unsigned char     num_rows;
  170.     unsigned char     num_doodads;
  171.     unsigned char     sz_rows;
  172.     unsigned char     sz_doodads;
  173.     XkbRowPtr     rows;
  174.     XkbDoodadPtr     doodads;
  175. } XkbSectionRec, *XkbSectionPtr;
  176.  
  177. typedef struct _XkbGeometry {
  178.     Atom         name;
  179.     unsigned short     width;
  180.     unsigned short     height;
  181.     unsigned short     sz_properties;
  182.     unsigned short     sz_colors;
  183.     unsigned short     sz_shapes;
  184.     unsigned short   sz_sections;
  185.     unsigned short     sz_doodads;
  186.     unsigned short     num_properties;
  187.     unsigned short     num_colors;
  188.     unsigned short     num_shapes;
  189.     unsigned short     num_sections;
  190.     unsigned short     num_doodads;
  191.     XkbPropertyPtr     properties;
  192.     XkbColorPtr     all_colors;
  193.     XkbShapePtr     all_shapes;
  194.     XkbSectionPtr     all_sections;
  195.     XkbDoodadPtr     all_doodads;
  196. } XkbGeometryRec;
  197.  
  198. #define    XkbGeomPropertiesMask    (1<<0)
  199. #define    XkbGeomPointsMask    (1<<1)
  200. #define    XkbGeomColorsMask    (1<<2)
  201. #define    XkbGeomOutlinesMask    (1<<3)
  202. #define    XkbGeomShapesMask    (1<<4)
  203. #define    XkbGeomSectionsMask    (1<<5)
  204. #define    XkbGeomDoodadsMask    (1<<6)
  205. #define    XkbGeomAllMask        (0x7f)
  206.  
  207. typedef struct _XkbGeometrySizes {
  208.     unsigned    which;
  209.     unsigned short    num_properties;
  210.     unsigned short    num_colors;
  211.     unsigned short    num_shapes;
  212.     unsigned short    num_sections;
  213.     unsigned short    num_doodads;
  214. } XkbGeometrySizesRec,*XkbGeometrySizesPtr;
  215.  
  216. _XFUNCPROTOBEGIN
  217.  
  218. extern    XkbPropertyPtr
  219. XkbAddGeomProperty(
  220. #if NeedFunctionPrototypes
  221.     XkbGeometryPtr    /* geom */,
  222.     char *        /* name */,
  223.     char *        /* value */
  224. #endif
  225. );
  226.  
  227. extern    XkbColorPtr
  228. XkbAddNamedColor(
  229. #if NeedFunctionPrototypes
  230.     XkbGeometryPtr    /* geom */,
  231.     char *        /* color */
  232. #endif
  233. );
  234.  
  235. extern XkbColorPtr
  236. XkbAddRGBColor(
  237. #if NeedFunctionPrototypes
  238.     XkbGeometryPtr    /* geom */,
  239.     int            /* red */,
  240.     int            /* green */,
  241.     int            /* blue */
  242. #endif
  243. );
  244.  
  245. extern    XkbOutlinePtr
  246. XkbAddGeomOutline(
  247. #if NeedFunctionPrototypes
  248.     XkbGeometryPtr    /* geom */,
  249.     XkbShapePtr        /* shape */,
  250.     int            /* sz_points */
  251. #endif
  252. );
  253.  
  254. extern XkbShapePtr
  255. XkbAddGeomShape(
  256. #if NeedFunctionPrototypes
  257.     XkbGeometryPtr    /* geom */,
  258.     XkbKeyNamePtr    /* name */,
  259.     int            /* sz_outlines */
  260. #endif
  261. );
  262.  
  263. extern XkbKeyPtr
  264. XkbAddGeomKey(
  265. #if NeedFunctionPrototypes
  266.     XkbGeometryPtr    /* geom */,
  267.     XkbRowPtr        /* row */
  268. #endif
  269. );
  270.  
  271. extern XkbRowPtr
  272. XkbAddGeomRow(
  273. #if NeedFunctionPrototypes
  274.     XkbGeometryPtr    /* geom */,
  275.     XkbSectionPtr    /* section */,
  276.     int            /* sz_keys */
  277. #endif
  278. );
  279.  
  280. extern XkbSectionPtr
  281. XkbAddGeomSection(
  282. #if NeedFunctionPrototypes
  283.     XkbGeometryPtr    /* geom */,
  284.     Atom        /* name */,
  285.     int            /* sz_rows */
  286. #endif
  287. );
  288.  
  289. extern void
  290. XkbFreeGeomProperties(
  291. #if NeedFunctionPrototypes
  292.     XkbGeometryPtr    /* geom */,
  293.     int            /* first */,
  294.     int            /* count */
  295. #endif
  296. );
  297.  
  298. extern void
  299. XkbFreeGeomShapes(
  300. #if NeedFunctionPrototypes
  301.     XkbGeometryPtr    /* geom */,
  302.     int            /* first */,
  303.     int            /* count */
  304. #endif
  305. );
  306.  
  307. extern void
  308. XkbFreeGeomSections(
  309. #if NeedFunctionPrototypes
  310.     XkbGeometryPtr    /* geom */,
  311.     int            /* first */,
  312.     int            /* count */
  313. #endif
  314. );
  315.  
  316. extern void
  317. XkbFreeGeometry(
  318. #if NeedFunctionPrototypes
  319.     XkbDescPtr        /* xkb */,
  320.     XkbGeometrySizesPtr    /* sizes */
  321. #endif
  322. );
  323.  
  324. extern    Bool
  325. XkbAllocGeometry(
  326. #if NeedFunctionPrototypes
  327.     XkbDescPtr        /* xkb */,
  328.     XkbGeometrySizesPtr    /* sizes */
  329. #endif
  330. );
  331.  
  332. _XFUNCPROTOEND
  333.  
  334. #endif /* _XKBSTR_H_ */
  335.